#ifndef MYDOWNLOADSDK_H
#define MYDOWNLOADSDK_H

#include <QtCore>
#include <QLibrary>
#include "ThunderOpenSDK/xldl.h"

class MyDownLoadSDK : public QObject
{
    Q_OBJECT
public:
    explicit MyDownLoadSDK(QObject *parent = nullptr);

public slots:
    void Init();
    void SetDownDir(QString strDir);
    // taskID is void*, replace it with int
    int CreateTaskTh(QString strUrl);
    int CreateTaskTh2(QString strUrl, QString strSaveDir, QString strCookie);
    bool QueryTaskTh(int pTaskID, DownTaskInfo& taskInfo);
    QString QueryTaskTh2Json(int pTaskID);
    bool DeleteTaskTh(int pTaskID);
    bool StopTaskTh(int pTaskID);
    void SetLimitSpeed(int nKBps);

public:
    QString m_strDownDir;
    QLibrary* m_pXL_DLL;
    XL_Init m_pXL_Init;
    XL_CreateTask m_pXL_CreateTask;
    XL_QueryTaskInfoEx m_pXL_QueryTaskInfoEx;
    XL_StopTask m_pXL_StopTask;
    XL_StartTask m_pXL_StartTask;
    XL_DeleteTask m_pXL_DeleteTask;
    XL_SetSpeedLimit m_pXL_SetSpeedLimit;

signals:

public slots:
};

#endif // MYDOWNLOADSDK_H
